package com.fz.mapper;

import com.fz.entity.Book;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * Created by webrx on 2017-08-23.
 */
public interface BookMapper {

    @Select("select * from db_book")
    public List<Book> query();

    @Insert("insert into db_book values(null,#{name},#{price},#{bdate})")
    public int insert(Book book);

    @Insert("insert into db_book values(null,#{name},#{price},#{bdate})")
    public int save(Map<String,Object> map);

    @Insert("insert into db_book values(null,#{n},#{p},#{b})")
    public int add(@Param("n") String name,@Param("p") double price,@Param("b") String bdate);


    public int bookadd(String n,double p);

    public Book queryById(int id);

    @Select("select name from db_book")
    public List<String> show();



}
